package com.atguigu.lease.common.utils;

import java.util.Random;

/**
 * ClassName  CodeUtils
 * Author  XiaojianOne
 * Date  2025/3/4 21:15
 * Version  8.0
 */

public class CodeUtils {

    public static String getRandomCode(Integer length){

        StringBuilder builder = new StringBuilder();

        Random random = new Random();

        for (int i = 0; i < length; i++) {

            int num = random.nextInt(10);

            builder.append(num);
        }
        return builder.toString();
    }
}
